bitkeeper revision 1.1159.1.124 (413c80f8x6TVGW53WE2vlecpb4z_KA)
authorcl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Mon, 6 Sep 2004 15:23:36 +0000 (15:23 +0000)
committercl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Mon, 6 Sep 2004 15:23:36 +0000 (15:23 +0000)
Avoid warning message when validating a linear pagedirectory mapping.

1  2 
xen/arch/x86/memory.c
xen/include/asm-x86/mm.h

Simple merge
index 147b5a6c71fb3d1e384dd4cbb170d608dcb12c05,944e5c3177610e91c14a33d3911ddd575fd6f634..894130d1439f3c3d397f50bbf8bfb9db9f58c3ca
@@@ -226,20 -233,32 +233,36 @@@ static inline int get_page_type(struct 
                      nx |= PGT_validated;
              }
          }
-         else if ( unlikely((x & PGT_type_mask) != type) )
+         else if ( unlikely((x & (PGT_type_mask|PGT_va_mask)) != type) )
          {
 -                DPRINTK("Bad type (saw %08x != exp %08x) for pfn %08lx\n",
 -                        x & PGT_type_mask, type, page_to_pfn(page));
+             if ( unlikely((x & PGT_type_mask) != (type & PGT_type_mask) ) )
+             {
-           if ((x & PGT_type_mask) != PGT_l2_page_table &&
-               type != PGT_l1_page_table)
-               DPRINTK("Unexpected type (saw %08x != exp %08x) for pfn %08lx\n",
-                       x & PGT_type_mask, type, page_to_pfn(page));
 +#ifdef VERBOSE
-             return 0;
++                if ( ((x & PGT_type_mask) != PGT_l2_page_table) ||
++                     ((type & PGT_type_mask) != PGT_l1_page_table) )
++                    DPRINTK("Bad type (saw %08x != exp %08x) for pfn %08lx\n",
++                            x & PGT_type_mask, type, page_to_pfn(page));
 +#endif
+                 return 0;
+             }
+             else if ( (x & PGT_va_mask) == PGT_va_mutable )
+             {
+                 /* The va backpointer is mutable, hence we update it. */
+                 nx &= ~PGT_va_mask;
+                 nx |= type; /* we know the actual type is correct */
+             }
+             else if ( unlikely((x & PGT_va_mask) != (type & PGT_va_mask)) )
+             {
+                 /* The va backpointer wasn't mutable, and is different. */
+                 DPRINTK("Unexpected va backpointer (saw %08x != exp %08x)"
+                         " for pfn %08lx\n", x, type, page_to_pfn(page));
+                 return 0;
+             }
          }
-         else if ( unlikely(!(x & PGT_validated)) )
+       else if ( unlikely(!(x & PGT_validated)) )
          {
              /* Someone else is updating validation of this page. Wait... */
-             while ( (y = page->u.inuse.type_info) != x )
+             while ( (y = page->u.inuse.type_info) == x )
              {
                  rep_nop();
                  barrier();